﻿using System;
using Windows.ApplicationModel.Resources;
using Windows.UI.Xaml.Data;

namespace PPCalc.Converters
{
    class PointsConverter:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            var loader = new ResourceLoader();
            var valor = (int) value;
            switch (valor)
            {
                case 0:
                    return loader.GetString("0Points");
                case 1:
                    return loader.GetString("1Point");
                default:
                    return string.Format(loader.GetString("Points"), valor);
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            throw new NotImplementedException();
        }
    }
}
